import request from '@/utils/request'

// 查询试驾预约列表
export function listInfo(query) {
  return request({
    url: '/business/info/list',
    method: 'get',
    params: query
  })
}

// 查询试驾预约详细
export function getInfo(id) {
  return request({
    url: '/business/info/' + id,
    method: 'get'
  })
}

// 新增试驾预约
export function addInfo(data) {
  return request({
    url: '/business/info',
    method: 'post',
    data: data
  })
}

// 修改试驾预约
export function updateInfo(data) {
  return request({
    url: '/business/info',
    method: 'put',
    data: data
  })
}

// 删除试驾预约
export function delInfo(id) {
  return request({
    url: '/business/info/' + id,
    method: 'delete'
  })
}

// 反馈
export function feedbackInfo(data) {
  return request({
    url: '/business/info/',
    method: 'patch',
    headers: {"cmd": "feedback"},
    data: data,
  })
}

// 查看当天可用的预约时间
export function infoEffectiveTime(params) {
  return request({
    url: '/business/info/effectiveTime',
    method: 'get',
    params: params
  })
}